package com.sanbi.erp.db.service;

import com.sanbi.erp.db.util.CheckoutUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.sanbi.erp.db.dao.ProviderMapper;
import com.sanbi.erp.db.domain.Provider;

import java.util.List;

@Service
public class ProviderService{

    @Resource
    private ProviderMapper providerMapper;

    
    public int deleteByPrimaryKey(Integer id) {
        return providerMapper.deleteByPrimaryKey(id);
    }

    
    public int insert(Provider record) {
        return providerMapper.insert(record);
    }

    
    public int insertSelective(Provider record) {
        return providerMapper.insertSelective(record);
    }

    
    public Provider selectByPrimaryKey(Integer id) {
        return providerMapper.selectByPrimaryKey(id);
    }

    
    public int updateByPrimaryKeySelective(Provider record) {
        return providerMapper.updateByPrimaryKeySelective(record);
    }

    
    public int updateByPrimaryKey(Provider record) {
        return providerMapper.updateByPrimaryKey(record);
    }

    /**
     * 查询所有商品信息
     * @return
     */
    public List<Provider> selectAll(String providerName) {
        if (CheckoutUtil.isEmptyString(providerName)) {
            providerName = null;
        }
        return providerMapper.selectAll(providerName);
    }

    /**
     * 查询所有商品信息
     * @return
     */
    public List<Provider> selectAllEasyExcel() {
        return providerMapper.selectAllEasyExcel();
    }

}
